<div style="position: absolute;top: 120px; left: 450px">
    <font style="font-size: 25px ;color: #e8198b">入库登记：</font>&nbsp;&nbsp;
</div>


<br>
<table class="altrowstable">
    <tr>
        <td>编号</td>
        <td>采购单编号</td>
        <td>创建时间</td>
        <td>供应商名称</td>
        <td>创建用户</td>
        <td>附加费用</td>
        <td>采购产品总价</td>
        <td>采购单总价格</td>
        <td>付款方式</td>
        <td>处理状态</td>
        <td>明细</td>
        <td>操作</td>
    </tr>
    <tbody id="putStoragePoMainBody">

    </tbody>
    <div  style="position: absolute; margin-top: 0px;padding-left: 700px">
        <ul id="page">分页</ul>
    </div>
</table>


<script type="text/html" id="putStoragePoMainTemplate">
    {{each data}}
    <tr>
        <td>{{$index+1}}</td>
        <td>{{$value.poID}}</td>
        <td>{{$value.createTime}}</td>
        <td>{{$value.venderCode}}</td>
        <td>{{$value.account}}</td>
        <td>{{$value.tipFee}}</td>
        <td>{{$value.productTotal}}</td>
        <td>{{$value.poTotal}}</td>
        <td>{{$value.payType}}</td>
        <td>{{$value.status}}</td>
        <td><font style="color: #e8198b" onclick="{{'getPoItem(\''+ $value.poID +'\')'}}">查看明细</font></td>
        <td><span style="color: #84fab0" onclick="{{'putStorage(\''+$value.poID+'\')'}}">入库</span></span></td>
    </tr>
    {{/each}}
</script>
<script>

    function putStorage(poID){
        var flag = window.confirm("确认入库");
        if (flag){
            Ajax.post('putStorage',{poID:poID},function (result) {
                doResult(result,function () {
                    alert(result.message);
                    show('putStorage.html');
                })
            })
        }

    }


    $(function () {
        showPage({
            currentPage: 1,
            pageSize: 3,
            url: '/getPutStorage',
            templateId: 'putStoragePoMainTemplate',
            contentId: 'putStoragePoMainBody',
        })
    });


    function getPoItem(Obj){
        Ajax.getHtml("poItem.html",function (html) {
            layer.open(
                {
                    type:1,
                    title:'明细查看',
                    area: ['800px',['400px']],
                    content: html,
                    btn: ['确认', '取消'],
                    yes:function () {
                        layer.closeAll();
                    }
                })
        });Ajax.post("getPoItem",{
            poID:Obj
            },function (result) {
                var str =template("poItems",result);
                document.getElementById("poItem").innerHTML=str;
                doResult(result,function () {

                })
            })
    }
</script>